Skip to content

feat(desktop): export transcript as Markdown (copy + download)#3126

Open
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/export-session
Open

feat(desktop): export transcript as Markdown (copy + download)#3126
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/export-session

Conversation

@HUQIANTAO
Copy link
Copy Markdown
Contributor

Many users paste Reasonix transcripts into GitHub issues, internal wikis, or design docs. There was no way to get a transcript out of the desktop app.

Add lib/exportSession.ts: a pure function that renders the items array to a Markdown document. Shape: title + metadata header, alternating '## User' / '## Assistant' sections, tool calls rendered as collapsible blocks, sub-agent calls nested under their parent, todo panels and exit_plan_mode cards skipped, compaction boundaries as blockquotes with collapsible summaries.

Two ways to use it from the topbar: single click copies the rendered Markdown to the clipboard; double click triggers a Blob download named reasonix-YYYY-MM-DD-HHMM.md.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
Many users paste Reasonix transcripts into GitHub issues, internal
wikis, or design docs when filing a bug or sharing an investigation.
There was no way to get a transcript out of the desktop app — the
data lives in the Webview's React state and the on-disk session
files are a bespoke format.

Add lib/exportSession.ts: a pure function that renders the items
array to a Markdown document. The shape matches what a reader
expects:

  # <title>
  - model: <ref>
  - workspace: <cwd>
  - started: <iso>
  - ended: <iso>
  - duration: 12m 34s

  ## User
  ...

  ## Assistant
  ...

  ### `tool_name`
  ```json
  { ...args }
  ```
  **output**
  ```
  ...tool output...
  ```
  **error** (if any)
  ```
  ...error body...
  ```

Sub-agent calls (parentId-bearing tool items) are rendered nested
under the parent task call. Todo panels and exit_plan_mode cards
are skipped — they were already shown live in the UI and the
plan-mode approval card itself, so re-emitting them would
duplicate. Notices are ephemeral. Compaction boundaries are
emitted as a blockquote with a collapsible summary <details>.

Two ways to use it from the topbar:

  - Single click:  copies the rendered Markdown to the clipboard
                    (the common case — paste into Slack/GitHub).
  - Double click: triggers a Blob download named
                    reasonix-YYYY-MM-DD-HHMM.md. Works in the
                    Wails WebView (the OS save dialog surfaces
                    for the download).

A future SaveTextFile bridge binding can route to a native
SaveFileDialog without changing the rendering path.
@esengine
Copy link
Copy Markdown
Owner

esengine commented Jun 6, 2026

Thanks! This conflicts with the latest main-v2 in App.tsx (several desktop PRs have since landed there). Could you rebase onto the latest main-v2? Rebasing your App.tsx-touching PRs (#3116, #2948) as one ordered chain avoids repeated conflicts. Happy to merge once green. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants